package com.wlin.leaf;

import me.wlin.leaf.TwitterIdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 项目名称：leafsnow
 * 类名称：demo
 * 类描述： ${DESCRIPTION}
 *
 * @author wlin
 * @version 1.0
 * @since 2019/4/11
 */
@SpringBootApplication
@RestController
@RequestMapping("sample/id")
public class Sample {

    @Autowired
    private TwitterIdWorker idWorker;

    public static void main(String[] args) {
        SpringApplication.run(Sample.class,args);
    }

    @GetMapping("")
    public long newId(){
        return idWorker.nextId();
    }



}
